package com.itheima.jobs;

import com.itheima.dao.OrderSettingDao;
import com.itheima.entity.Result;
import com.itheima.service.OrderService;
import com.itheima.service.OrderSettingService;
import com.itheima.utils.DateUtils;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import redis.clients.jedis.JedisPool;


import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @CreateTime: 2019-11-14 14:02
 * @Description: 数据库把数据清理
 * @name:xiaoyue 获取年月日
 */
@Component
public class Database {

    @Autowired
    private OrderSettingDao orderSettingDao ;
    public void deleteDatabase() throws Exception {
        String date = DateUtils.parseDate2String(DateUtils.getFirstDay4ThisMonth());
        orderSettingDao.delete(date);
    }
}
